// 关于收款单的所有接口
import axiosp from '@/apis/axios/indexp.js'
const baseUrl = `/erp`

// 收款单列表信息
export function getlist(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/listPage`,
		method: 'post',
		data: params
	})
}
// 新增收款单
export function addData(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/addData`,
		method: 'post',
		data: params
	})
}
// 修改收款单
export function updateData(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/updateData`,
		method: 'post',
		data: params
	})
}
// 删除收款单
export function deleteById(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/deleteById`,
		method: 'post',
		data: params
	})
}

// 作废
export function cancel(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/cancel`,
		method: 'post',
		data: params
	})
}
// 根据ID获取收款单
export function getViewDataByBillId(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/viewDataByBillId`,
		method: 'post',
		data: params
	})
}
// 审核收款单
export function audit(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/audit`,
		method: 'post',
		data: params
	})
}

// 获取单号和日期的接口
export function initAddBill(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/initAddBill`,
		method: 'post',
		data: params
	})
}

// 获取当前欠款
export function getLastRemainDebtTotal(params) {
	return axiosp.request({
		url: `${baseUrl}/reconciliation/customer/getLastRemainDebtTotal`,
		method: 'post',
		data: params
	})
}
// 获取单据
export function getListCanWriteOffBillsByCustomerId(params) {
	return axiosp.request({
		url: `${baseUrl}/finBill/receive/writeOff/listCanWriteOffBillsByCustomerId`,
		method: 'post',
		data: params
	})
}

